#pragma once

#include "shapedisplayobj.h"

class HPoint;

class DEF_MODELOBJ CPolygonDisplayObj :
	public CShapeDisplayObj
{
public:
	CPolygonDisplayObj(CEntityObj *pEntity);
	CPolygonDisplayObj(CPolygonDisplayObj* pSrcPolyDis);
	~CPolygonDisplayObj(void);
	void Display(CHoopsMap *pHoopsMap);
	virtual bool GetBox(double & dblLeft, double & dblBottom, double & dblRight, double & dblTop);

	virtual int GetHandleCount();
	virtual HPoint GetHandle(int nHandle);
	virtual HCURSOR GetHandleCursor(int nHandle);
	
	virtual eDisplayObjType GetDisplayObjType() const {return SHAPENOTE_POLYGON;}
	vector<HPoint> GetAllPoints() const {return m_pts;}
	void ChangeLastPointAs(HPoint pt) {m_pts.back() = pt;}
	void AddPoint(HPoint pt) {m_pts.push_back(pt);}
	virtual void Serialize(CArchive & ar);
	void ChangeAllPoints(vector<HPoint> newPoints);
	void ChangeOnePoint(int Pos,HPoint newPoint);
	void ReSetAllPoints( vector<HPoint> newPoints );
private:
	vector<HPoint> m_pts;
};

